Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce CONNECT threadpool #31546

Closed

Conversation

DaveCTurner
Copy link
Contributor

Today we attempt to (re-)connect to our peers using the management threadpool.
However, during a network partition there may sometimes be a large number of
concurrent connection attempts. Connection attempts to partitioned nodes or to
nodes in containers that are no longer running can hang until they timeout,
possibly blocking other reconnection attempts and other management activity for
an extended period of time. Moreover, connecting to a peer is a relatively
lightweight operation so it is reasonable to attempt a lot of them in parallel.

This change introduces a separate threadpool solely for connecting to peers.

Fixes #29023.

Today we attempt to (re-)connect to our peers using the management threadpool.
However, during a network partition there may sometimes be a large number of
concurrent connection attempts. Connection attempts to partitioned nodes or to
nodes in containers that are no longer running can hang until they timeout,
possibly blocking other reconnection attempts and other management activity for
an extended period of time.  Moreover, connecting to a peer is a relatively
lightweight operation so it is reasonable to attempt a lot of them in parallel.

This change introduces a separate threadpool solely for connecting to peers.

Fixes elastic#29023.
@DaveCTurner DaveCTurner added >enhancement :Distributed Coordination/Network Http and internode communication implementations v7.0.0 :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. v6.4.0 labels Jun 24, 2018
@DaveCTurner DaveCTurner requested review from bleskes and ywelsch June 24, 2018 19:27
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@@ -186,6 +188,8 @@ public ThreadPool(final Settings settings, final ExecutorBuilder<?>... customBui
builders.put(Names.FETCH_SHARD_STARTED, new ScalingExecutorBuilder(Names.FETCH_SHARD_STARTED, 1, 2 * availableProcessors, TimeValue.timeValueMinutes(5)));
builders.put(Names.FORCE_MERGE, new FixedExecutorBuilder(settings, Names.FORCE_MERGE, 1, -1));
builders.put(Names.FETCH_SHARD_STORE, new ScalingExecutorBuilder(Names.FETCH_SHARD_STORE, 1, 2 * availableProcessors, TimeValue.timeValueMinutes(5)));
builders.put(Names.CONNECT, new ScalingExecutorBuilder(Names.CONNECT, 1,
boundedBy(10 * availableProcessors, 10, 100), TimeValue.timeValueSeconds(10)));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB I do not know if these numbers are reasonable.

@jasontedor
Copy link
Member

There is an open community PR for this: #30150.

@DaveCTurner
Copy link
Contributor Author

So there is. I'll look at that in more detail tomorrow.

@DaveCTurner DaveCTurner deleted the 2018-06-24-connect-threadpool branch July 23, 2022 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. :Distributed Coordination/Network Http and internode communication implementations >enhancement >non-issue v6.4.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants